<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    .box{
      height: 60px;
      width: 60px;
      background-color: #283dff;
    }
    .change{
      height: 60px;
      width: 60px;
      background-color: #d6ff74;
    }
  </style>
</head>
<body>
<!--<div class="box" style="height: 500px;width: 500px;background-color: #5f25cc;"></div>-->
<div class="box"></div>
<script>
  // var div = document.querySelector('div');
  // div.onclick = function () {
  //   div.style.backgroundColor = '#cc1c1c';
  //   div.style.width = '600px';
  // }
  var box = document.querySelector('.box');

  box.onclick = function () {
    this.className = 'change'
  }
</script>
</body>
</html>